package com.example.makerspace.controller;


import com.example.makerspace.dto.Result;
import com.example.makerspace.service.DreamService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

@RequestMapping("/api/dream")
@ResponseBody
@Controller
public class DreamController {
    @Resource
    private DreamService dreamService;


    @PostMapping("/gpt")
    public void gpt(@RequestBody Map<String, Object> params, HttpServletResponse response){
        dreamService.gpt(params, response);
    }

    @PostMapping("/clear")
    public Result clear(@RequestBody Map<String, Object> params){
        return dreamService.clear(params);
    }

}
